package com.shw.pclient.adapter;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;

public class SHWMainService extends Service {

	private IBinder binder=new SHWMainService.SHWMainBinder();
	
	@Override
	public IBinder onBind(Intent arg0) {
		return binder;
	}

	@Override
	public void onCreate() {
		SHWTrigger.openConnect(this);
		SHWTrigger.openGPS(this);
		SHWGPSHandler.GPSInfo(this);
		SHWNetManager netManager=new SHWNetManager(this);
		netManager.startSendRevThread();
	}
	
	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		return START_STICKY;
	}

	@Override
	public void onDestroy() {
		System.out.println("The service is stop");
	}
	
	public class SHWMainBinder extends Binder{
		SHWMainService getService(){
			return SHWMainService.this;
		}
	}

}
